# == Schema Information
# Schema version: 20100706080509
#
# Table name: events
#
#  id          :integer         not null, primary key
#  name        :string(255)
#  time        :datetime(255)
#  location    :string(255)
#  description :text
#  created_at  :datetime
#  updated_at  :datetime
#  icon        :string(255)
#

class Event < ActiveRecord::Base
  belongs_to :user
  cattr_reader :per_page
  @@per_page = 10

  named_scope :open, :conditions => {:open => true}
  named_scope :closed, :conditions => {:open => false}

  def time=(str)
    write_attribute :time, DateTime::parse(str)
  end

  def time
    read_attribute :time
  end

end
